package com.sl.core.engine.utils;

import cn.hutool.core.util.ObjectUtil;
import com.sl.core.engine.step.impl.AbstractProcessComp;
import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Type;

@Slf4j
public class ProcessTypeUtil {

    public static Type getParamTypeClass(Class<? extends AbstractProcessComp> aClass) {
        if (ObjectUtil.isNull(aClass)) {
            return null;
        }
        Type typeArgument = null;
        try {
            typeArgument = cn.hutool.core.util.TypeUtil.getTypeArgument(aClass);
        } catch (Exception e) {
            log.error("获取范型失败", e);
        }
        return typeArgument;
    }
}
